﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Gmantis.Controls
{
    public class KeyEventArgs
    {
        // Fields
        private bool _handled;

        // Methods
        public KeyEventArgs()
        {
        }

        public KeyEventArgs(System.Windows.Input.KeyEventArgs e)
        {
            this.Key = e.Key;
            this.PlatformKeyCode = e.GetPlatformKeyCode();
            this.Handled = e.Handled;
            this.Args = e;
        }

        // Properties
        public System.Windows.Input.KeyEventArgs Args { get; set; }

        public bool Handled
        {
            get
            {
                return this._handled;
            }
            set
            {
                this._handled = value;
                if (this.Args != null)
                {
                    this.Args.Handled = value;
                }
            }
        }

        public Key Key { get; set; }

        public int PlatformKeyCode { get; set; }
    }

    public class TextEditedEventArgs : EventArgs
    {
        // Properties
        public bool Cancel { get; set; }

        public int CurrentSelectionStart { get; set; }

        public string CurrentText { get; set; }

        public Key LastKey { get; set; }

        public int NewSelectionStart { get; set; }

        public string NewText { get; set; }
    }
}
